package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.warehouse;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface warehouseMapper extends BaseMapper<warehouse> {
    //继承mybatisplus的sql方法
    @Select("select * from view_warehouse where comsign=#{comsign} and comname=#{comname}")
    public List<warehouse> selectComsign(warehouse warehouse);//参数封装到对象里方便使用

    @Update("update view_warehouse set comname=#{comname},comsign=#{comsign},comnum=#{comnum},"+
            "com_in_date=#{com_in_date},com_out_date=#{com_out_date} where comsign=#{comsign} and comname=#{comname}")
    public int  updatewarehouse(warehouse warehouse);//参数封装到对象里方便使用
    @Delete("delete from view_warehouse where comsign=#{comsign} and comname=#{comname}")
    public int deletewarehouse(String comname, String comsign);


}
